package com.zhuang.factory.absfactory;

import com.zhuang.factory.simplefactory.Circle;
import com.zhuang.factory.simplefactory.Rectangle;
import com.zhuang.factory.simplefactory.Square;

/**
 * @Classname ColorFactory
 * @Description 颜色工厂类的编写
 * @Date 2021/3/18 16:05
 * @Created by dell
 */

public class ColorFactory extends AbstractFactory {
    @Override
    public Shape createShape(String shapeType) {
        return null;
    }

    @Override
    public Color createColor(String colorType) {
        if ("Red".equalsIgnoreCase(colorType)) {
            return new Red();
        }
        if ("Black".equalsIgnoreCase(colorType)) {
            return new Black();
        }
        if ("Yellow".equalsIgnoreCase(colorType)) {
            return new Yellow();
        }
        return null;
    }
}
